package practice;

public class TimeAccountTester1 {//写个测试类

    public static void main(String[] args) {


        Account2 adachi=new Account2("足利","123245",2000);
        TimeAccount nakata=new TimeAccount("zhangchunbai","888888888",800000,40000);
        Account2 x;
        x=adachi;//父类类型变量，可以引用自身类型的实例
        x=nakata;//也可以引用子类类型实例
        System.out.println(x.getBalance());

        TimeAccount y;
        //y=adachi;
        y=nakata;
        System.out.println(y.getBalance());
        System.out.println(y.getTimeBalance());
    }

}
